/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.cib.fintech.entrustedinvestment.biz.domain.fpss;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import com.cib.fintech.entrustedinvestment.biz.key.ProdNavInfoEntityPkey;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author zhangqingkun
* @date 2020-09-28
**/
@Entity
@Data
@Table(name="fpss_prod_nav_info")
@IdClass(ProdNavInfoEntityPkey.class)
public class ProdNavInfo implements Serializable {

    @Column(name = "fpss_prod_nav_info")
    @ApiModelProperty(value = "表名")
    private String fpssProdNavInfo;

    @Id
    @Column(name = "nav_date")
    @ApiModelProperty(value = "净值日期")
    private String navDate;

    @Column(name = "prov_nav")
    @ApiModelProperty(value = "分红前净值")
    private String provNav;

    @Column(name = "after_nav")
    @ApiModelProperty(value = "分红后净值")
    private BigDecimal afterNav;

    @Column(name = "divid_nav")
    @ApiModelProperty(value = "分红净值")
    private BigDecimal dividNav;

    @Column(name = "total_nav")
    @ApiModelProperty(value = "累计净值")
    private BigDecimal totalNav;

    @Column(name = "income_miloin")
    @ApiModelProperty(value = "万份收益（货基）")
    private BigDecimal incomeMiloin;

    @Column(name = "income_seven")
    @ApiModelProperty(value = "七日年化收益")
    private BigDecimal incomeSeven;

    @Column(name = "manage_fee")
    @ApiModelProperty(value = "管理费率管理费")
    private BigDecimal manageFee;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Id
    @Column(name = "prod_code")
    @ApiModelProperty(value = "产品代码")
    private String prodCode;

    public void copy(ProdNavInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}